import request from "@/utils/request.js";
import api from "@/api/index.js";

export const reqAllRoles = () => {
    return request({
        url: api.reqAllRolesURL,
        method: 'GET'
    })
}
export const reqRoleListByCondition = (like) => {
    return request({
        url: api.reqRoleListByConditionURL+`?like=${like}`,
        method: 'GET'
    })
}

export const reqAddRole = (role) => {
    return request({
        url: api.reqAddRoleURL,
        method: 'POST',
        data: role
    })
}

export const reqGiveMenu = (role) => {
    return request({
        url: api.reqGiveMenuURL,
        method: 'POST',
        data: role
    })
}

export const reqRemoveRoleByRoleId=(roleId)=>{
    return request({
        url:api.reqRemoveRoleByRoleIdURL+`/${roleId}`,
        method:'DELETE'
    })
}
